package model;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * @author: Jacky Chai
 * @date: 2019/4/19
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PageResult<T> extends BaseObject implements Serializable {

    private static final long serialVersionUID = -6205273669904344139L;

    @ApiModelProperty(value = "分页信息", required = true)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private PageInfo page;
    @ApiModelProperty(value = "业务相应数据", required = true)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<T> data;

    public PageResult() {

    }

    public PageResult(PageInfo page, List<T> data) {
        this.page = page;
        this.data = data;
    }
}
